package com.lindom.dao;
import com.lindom.pojo.User;
import org.mybatis.spring.SqlSessionTemplate;
import java.util.List;

public class UserDaoImpl implements UserMapper {

    //sqlSession不用我们自己创建了，Spring来管理
    private SqlSessionTemplate sqlSeesion;

    public void setSqlSeesion(SqlSessionTemplate sqlSeesion) {
        this.sqlSeesion = sqlSeesion;
    }

    public List<User> selectUser() {
        UserMapper mapper = sqlSeesion.getMapper(UserMapper.class);
        List<User> list = mapper.selectUser();
        return list;
    }
}
